﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DBSystem.Entities;
using DBSystem.BussinessLogic;
using Microsoft.Practices.Unity;
//using Microsoft.Practices.Unity.Configuration;     

namespace DBSystem.WebMvc.Controllers
{
    public class HomeController : Controller
    {
        //IProductoBL productoBL;

        [Dependency]
        public IProductoBL  ProductoBL { get; set; }

       /* public HomeController()
        {
            //productoBL = new ProductoBL(); 

            using (IUnityContainer container = new UnityContainer() )
            {
                container.LoadConfiguration();
                container.BuildUp(this.GetType(), this);   
            }
        }*/

        public ActionResult Index()
        {
            ViewBag.Message = "ASP.NET MVC";
            return View();
        }

        public ActionResult ListProductos()
        {
            var lista = ProductoBL.GetAllFromProducto();
  
            return View(lista); 
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
